<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1 >
        账号:<input id="account" type="text"><br>
        密码:<input type="password" id="pwd"><br>
        <button id="doLogin">进行登录！！！</button>
    </h1>
    <script>
        document.getElementById("doLogin").addEventListener("click",function(){
            fetch("/login",{
                method:"post",
                body:JSON.stringify({
                    account:account.value,
                    pwd:pwd.value
                })
            }).then(val=>{
                console.log(val);
            }).catch(err=>{
                console.log(err);
            })
        })
    </script>
</body>
</html>